package com.cn.yunhe.rentcars.web;

import java.util.Map;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
	
    private static Logger logger = LoggerFactory.getLogger(IndexController.class);

	@RequestMapping("/home")
	public String index(Map<String, Object> model) {
        Subject subject = SecurityUtils.getSubject();
		model.put("username",subject.getSession().getAttribute("username"));
		return "home";
	}
	
	@RequestMapping("/403")
	public String unauthorizedRole(){
		logger.info("------没有权限-------");
		return "403";
	}
}
